<!doctype html>
<html class="x-admin-sm">
    <head>
        <meta charset="UTF-8">
        <title>提瓦特物流仓库管理系统</title>
        <meta name="renderer" content="webkit"/>
        <link rel="stylesheet" href="../../css/font.css"/>
        <link rel="stylesheet" href="../../css/xadmin.css"/>
        <script src="../../lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="../../js/xadmin.js"></script>
        <script src="../../js/vue2.7min.js"></script>
        <script src="../../js/axios.min.js"></script>
    </head>
    <body class="index">
        <!-- 顶部开始 -->
        <div class="container" id="app">
            <div class="logo">
                <a href="./index.html">提瓦特物流仓库管理系统</a></div>
            <div class="left_open">
                <a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
            </div>
            <ul class="layui-nav right" lay-filter="">
                <li class="layui-nav-item">
                    <a href="javascript:;" v-text="name"></a>
                    <dl class="layui-nav-child">
                        <!-- 二级菜单 -->
                        <dd>
                            <a @click="logout">退出</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
        <!-- 顶部结束 -->
        <!-- 中部开始 -->
        <!-- 左侧菜单开始 -->
        <div class="left-nav">
            <div id="side-nav">
                <ul id="nav">
                    <!--开始左侧菜单栏-->

                    <li v-show="level===0">
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="管理员管理">&#xe6b8;</i>
                            <cite>管理员管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('管理员信息展示','../manager/manager-list.html')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>管理员信息展示</cite></a>
                            </li>

                        </ul>
                    </li>

                    <li v-show="level===0">
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="供应商管理">&#xe6b8;</i>
                            <cite>供应商管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('供应商信息展示','../supplier/supplier-list.html')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>供应商信息展示</cite></a>
                            </li>

                        </ul>
                    </li>
                    <li v-show="level===0">
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="商品管理">&#xe6b8;</i>
                            <cite>商品管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('商品信息展示','../goods/goods-list.html')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>商品信息展示</cite></a>
                            </li>

                        </ul>
                    </li>
                    <li v-show="level===0">
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="仓库管理">&#xe6b8;</i>
                            <cite>仓库管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('仓库信息展示','../warehouse/warehouse-list.html')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>仓库信息展示</cite></a>
                            </li>

                        </ul>
                    </li>
                    <li v-show="level===0">
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="出入库记录">&#xe6b8;</i>
                            <cite>出入库记录</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('入库信息展示','../log/purchase-log.html')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>入库记录</cite></a>
                            </li>

                        </ul>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('出库信息展示','../log/sell-log.html')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>出库记录</cite></a>
                            </li>

                        </ul>
                    </li>
                    <li v-show="level===0">
                        <a href="javascript:;">
                            <i class="iconfont left-nav-li" lay-tips="顾客管理">&#xe6b8;</i>
                            <cite>顾客管理</cite>
                            <i class="iconfont nav_right">&#xe697;</i></a>
                        <ul class="sub-menu">
                            <li>
                                <a onclick="xadmin.add_tab('顾客信息展示','../customer/customer-list.html')">
                                    <i class="iconfont">&#xe6a7;</i>
                                    <cite>顾客信息展示</cite></a>
                            </li>

                        </ul>
                    </li>
                </ul>
            </div>
        </div>
        <!-- <div class="x-slide_left"></div> -->
        <!-- 左侧菜单结束 -->
        <!-- 右侧主体开始 -->
        <div class="page-content">
            <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
                <ul class="layui-tab-title">
                    <li class="home">
                        <i class="layui-icon">&#xe68e;</i>我的桌面
                    </li>
                </ul>
                <div class="layui-unselect layui-form-select layui-form-selected" id="tab_right">
                    <dl>
                        <dd data-type="this">关闭当前</dd>
                        <dd data-type="other">关闭其它</dd>
                        <dd data-type="all">关闭全部</dd>
                    </dl>
                </div>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <iframe src='./welcome.html' frameborder="0" scrolling="yes" class="x-iframe"></iframe>
                    </div>
                </div>
                <div id="tab_show"></div>
            </div>
        </div>
        <div class="page-content-bg"></div>
        <style id="theme_style"></style>
        <!-- 右侧主体结束 -->
        <!-- 中部结束 -->

        <script type="text/javascript">
            var vm = new Vue({
                el: "#app",
                data: {
                    //账号信息
                    id: null,
                    name: null,
                    level: null,
                    phone: null,
                    realName: null, sex: null,
                    status: null,
                    //分页信息


                },
                methods: {
                    //获取url参数
                    url1(name) {
                        //获取上一地址中的get参数
                        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
                        var r = window.location.search.substr(1).match(reg);
                        if (r != null)
                            return unescape(r[2]);
                        return null;
                    },
                    //登出功能
                    logout() {
                        console.log("开始触发登出操作");
                        axios.post("../../../red/logout")
                            .then(function (response) {
                                console.log(response);
                                vm.msg = response.data.msg;
                                //判断是否登录
                                if (response.data.code === 1) {
                                    //页面跳转
                                    window.location.href = '../login.html?msg=successLogout';
                                } else {

                                }
                            }, function (err) {
                                console.log(err);

                            })
                    },
                    //根据id获取账号信息。判断身份，展示不同页面信息
                    getManagerInfo() {
                        axios.post("../../../manager/getOneById")
                            .then(function (response) {
                                //数据保存到vue全局
                                if (response.data.code === 1) {
                                    vm.id = response.data.data.id;
                                    vm.name = response.data.data.name;
                                    vm.level = response.data.data.level;
                                    vm.phone = response.data.data.phone;
                                    vm.sex = response.data.data.sex;
                                    vm.status = response.data.data.status;
                                } else {
                                }
                            }, function (err) {
                                console.log(err);

                            })
                    }
                },
                mounted: function () {
                    //查询用户信息
                    this.getManagerInfo();
                    //判断用户权限并设置
                }, created: function () {
                    //在页面构筑前操作
                }
            });
        </script>


    </body>

</html>